var express = require('express');
var router = express.Router();
const connection = require('../database/mysql')
const path = require('path')
const sql = require('../routehandles/mysqlhandle');
const { request } = require('http');



router.post('/jobjieshou',async (req,res) => {
    const params = req.body;
    var access = await sql.sAccessTable(params.username);//得到json对象数组

    var count = Object.keys(access).length;
    var b = []
    for(i=0;i<count;i++){
        var id =access[i]['tasknum']
        var a = await sql.sPublishTableById(id);
        b.push(a)
    }
    return res.json({b,result:'true'})

})

module.exports = router